All Packages Class Hierarchy This Package Previous Next Index
Class quicktime.sound.SndHandle
java.lang.Object
|
+----quicktime.QTObject
|
+----quicktime.util.QTHandleRef
|
+----quicktime.util.QTHandle
|
+----quicktime.sound.SndHandle
- public final class SndHandle
- extends QTHandle
- implements QuickTimeLib, SoundLib
-
SndHandle(int, boolean)
- Construct an empty handle that must be initialized by the setupHeader call.
-
SndHandle(int, float, int, int, int)
- Construct a sound resource for containing sampled sound that can be used to record and play sound.
-
appendSoundBuffer(int)
- Appends the specified number of bytes to the SoundHandle after
the header.
-
appendSoundData(QTPointerRef)
- Appends the sound buffer to the end of this handle.
-
getSoundData()
- Return a Pointer to the sound data that is contained within the SndHandle.
-
getSoundHeaderOffset()
- The number of bytes from the beginning of the sound resource specified by the sndHdl parameter to the sound header that is contained within.
-
parseSndHeader()
- You use this function to retrieve information about a SndHandle.
-
setupHeader(int, float, int, int, int, int)
- You can use the SetupSndHeader function to construct a sound resource containing sampled sound that can be passed to the SndPlay function.
SndHandle
public SndHandle(int size,
boolean clear) throws QTException
- Construct an empty handle that must be initialized by the setupHeader call.
- Parameters:
- size - how many bytes to allocate
- clear - if true the handle's memory is cleared to zeroes.
SndHandle
public SndHandle(int numChannels,
float sampleRate,
int sampleSize,
int compressionType,
int baseNote) throws QTException
- Construct a sound resource for containing sampled sound that can be used to record and play sound.
You must append the actual sample data to the created SndHandle before it can be used to
record or play.
QuickTime::SetupSndHeader
- Parameters:
- numChannels - the number of channels for the sound
- sampleRate - the rate at which the sound was recorded
- sampleSize - The sample size for the original sound (that is, bits per sample).
- compressionType - The compression type for the sound ('NONE', 'MAC3', 'MAC6', or other third-party types).
- baseNote - The base note for the sound, expressed as a MIDI note value.
setupHeader
public int setupHeader(int numChannels,
float sampleRate,
int sampleSize,
int compressionType,
int baseNote,
int numBytes) throws SoundException
- You can use the SetupSndHeader function to construct a sound resource containing sampled sound that can be passed to the SndPlay function.
QuickTime::SetupSndHeader
- Parameters:
- numChannels - the number of channels for the sound
- sampleRate - the rate at which the sound was recorded
- sampleSize - The sample size for the original sound (that is, bits per sample).
- compressionType - The compression type for the sound ('NONE', 'MAC3', 'MAC6', or other third-party types).
- baseNote - The base note for the sound, expressed as a MIDI note value.
- numBytes - The number of bytes of audio data that are to be stored in the handle. (This value is not necessarily the same as the number of samples in the sound.)
- Returns:
- the size (in bytes) of the 'snd ' resource header that is created
getSoundHeaderOffset
public final int getSoundHeaderOffset() throws SoundException
- The number of bytes from the beginning of the sound resource specified by the sndHdl parameter to the sound header that is contained within.
QuickTime::GetSoundHeaderOffset
- Returns:
- the offset to the sound header
getSoundData
public QTPointerRef getSoundData() throws QTException
- Return a Pointer to the sound data that is contained within the SndHandle.
The SndHandle will be locked by this call and should remain locked for the
life of the returned data object.
- Returns:
- a QTPointer to the Sound data
appendSoundData
public void appendSoundData(QTPointerRef buffer) throws QTException
- Appends the sound buffer to the end of this handle. This is required
before the SndHandle can be used for recording or playing sound.
If a pre-existing buffer has been appended this will be removed and
replace with the incoming buffer. This will copy the incoming buffer.
- Parameters:
- buffer - the buffer that contains the actual sound data.
appendSoundBuffer
public void appendSoundBuffer(int bufferSize) throws QTException
- Appends the specified number of bytes to the SoundHandle after
the header. The call resizes the SndHandle to the sound header offset + buffer size.
- Parameters:
- bufferSize - the number of bytes to append for the sound buffer
parseSndHeader
public final SndInfo parseSndHeader() throws SoundException
- You use this function to retrieve information about a SndHandle.
QuickTime::ParseSndHeader
- Returns:
- a SndInfo object
All Packages Class Hierarchy This Package Previous Next Index